﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public class AB05AV95Report : BaseReport
    {
        string strCompany = "HLT";
        string strExcelFile = "";
        public AB05AV95Report()
            : base()
        {
        }
        public AB05AV95Report(Dictionary<string, object> dicParamater)
            : base(dicParamater)
        { 
            strCompany = dicParamater["Company"].ToString().Trim();
            strExcelFile = dicParamater["ExcelFile"].ToString().Trim();
            columns.Clear(); 
            columns.Add("FPRODUCER"); 
            columns.Add("GPRODUCER");
            columns.Add("GISSUEDATE"); 
            columns.Add("ARTICLE"); 
            columns.Add("SIZEBATCHNO"); 
            columns.Add("ABPLOT"); 
            columns.Add("GPCNUM"); 
            columns.Add("GMETER");
            columns.Add("ABPLIEFDAT");
            columns.Add("FGETDATE");
            columns.Add("FNGRDIFF"); 
            columns.Add("FPCNUM"); 
            columns.Add("FMETER"); 
            columns.Add("FGWASTAGE"); 
            columns.Add("ABPBESCHICH");  
        } 
        public void WriteExcelReport(string fileType)
        {  
            Queue CellQueue = new Queue(); 
         
            string filename = "";
            string sheetName = "";
            string Standard = "AB05AV95";
            strExcelFile = @"HLT\HLTPlanningReport.xls";
            string filePath = @"C:\intex.w\Report\" + strExcelFile;
            exAgent.Open(filePath);
            exAgent.Company = strCompany;
            exAgent.strExcelFile = strExcelFile;
            string filedate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
            filename = @"Planning\后整理\FB" + filedate + ".xls";
            sheetName = DateTime.Now.ToShortTimeString().Replace(@":","");
            exAgent.CreateNewSheet(filename, Standard, sheetName);
            FillInData(columns, dsSource.Tables["ABPOS"]); 
            if (exAgent != null)
            {
                exAgent.Save();
                exAgent.Close();
            }
        }

    }

}
